<template>
	<!-- <div class="bg_div">
		<img class="bg_img" :src="require('@/assets/images/21092500230L092-0-lp.jpg')" alt="">
	</div> -->
	<view class="menu_box">
		<div class="logo_menu">
			<img class="logo" src="//fes.qyerstatic.com/FgP-BkmxyKWjMKv-bAbvpXg4G2r2?imageslim" width="76" height="36">
			<!-- 一级菜单组件 -->
			<MenuOne></MenuOne>
		</div>
		<div class="function_box">
			<div class="search_box">
				<input class="search_input" type="text">
				<img class="search_icon" :src="require('@/assets/images/搜索.png')" alt="">
			</div>
			<img class="search_icon_hidden" :src="require('@/assets/images/搜索 (2).png')" alt="">
			|
			<img class="icon" :src="require('@/assets/images/淘宝.png')" alt="">
			<img class="icon" :src="require('@/assets/images/qq.png')" alt="">
			<img class="icon" :src="require('@/assets/images/微信 (1).png')" alt="">
			<img class="icon" :src="require('@/assets/images/新浪微博.png')" alt="">
			<p class="rigister">注册</p>
			<p class="login">登录</p>
			<img class="avatar" src="" alt="" @click="toPage()">
			<p class="name_info"></p>
		</div>
	</view>
	<view class="search_box">
		<!--  -->
	</view>
	<view class="roll_box">
		<!--  -->
	</view>
</template>

<script>
// @ is an alias to /src
import MenuOne from '@/components/MenuOne.vue'

import indexAPI from "@/api/indexAPI"

export default {
    name: 'HomeView',
    components: {
        MenuOne
    },
	mounted() {
		this.getMenuOne()
	},
    data() {
        return {
            avatar: ''
        }
    },
    methods: {
        toPage() {
            console.log('还没配置路由');
            this.$router.push('/userInfo');
        },
		getMenuOne(){
			indexAPI.getMenuOne().then(resp=>{
				console.log(resp);
			})
		}
    }
}
</script>

<style lang="scss">
@import "../../public/public.scss";

.menu_box {
    width: 100%;
    height: 60px;
    background: linear-gradient(180deg, rgba(0, 0, 0, .3) 10%, transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 30px;
    box-sizing: border-box;

    .logo_menu {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;

        .logo {
            width: 76px;
            height: 36px;
            margin-right: 18px;
        }

        .menu_val {
            height: 100%;
            position: relative;
            white-space: normal;

            .pre_line {
                width: 100%;
                height: 0px;
                background-color: white;
                z-index: 1;
                position: absolute;
                transition: height 0.1s linear;
            }

            .menu_val_box {
                padding: 0px 12px 0px 12px;
                z-index: 0;
                display: flex;
                align-items: center;
                justify-content: center;
                height: 100%;
                white-space: normal;

                .content {
                    color: #fff;
                    font-weight: 600;
                    font-size: 16px;
                    white-space: normal;
                    flex-shrink: 0;
                }

                .icon {
                    width: 16px;
                    height: 16px;
                    transform: rotate(90deg);
                    margin-left: 4px;
                    flex-shrink: 0;
                }
            }

            .menu_two::before {
                content: "";
                display: block;
                position: absolute;
                top: -12px;
                left: 22px;
                width: 0;
                height: 0;
                font-size: 0;
                border-color: transparent transparent #fff;
                border-style: solid;
                border-width: 6px 4px
            }

            .menu_two {
                position: absolute;
                display: none;
                padding: 8px 0px;
                top: 55px;
                z-index: 200;
                border-radius: 4px;
                background: #fff;
                box-shadow: 0 0 3px rgba(0, 0, 0, .1);
                line-height: 30px;
                white-space: nowrap;

                .menu_two_val {
                    width: auto;
                    padding: 0px 8px;
                    display: flex;
                    align-items: center;

                    .name_val {
                        color: #636363;
                        font-size: 16px;
                        flex-shrink: 0;
                        padding: 0px 4px;
                    }

                    .icon {
                        width: 16px;
                        height: 16px;
                    }

                    .menu_three {
                        position: absolute;
                        display: none;
                        width: 460px;
                        z-index: 200;
                        border-radius: 4px;
                        min-width: 100px;
                        top: 0;
                        left: 100%;
                        padding: 4px 12px;
                        background: 0 0;
                        white-space: normal;
                        background: #fff;
                        box-shadow: 0 0 3px rgba(0, 0, 0, .1);

                        .section_title {
                            font-size: 16px;
                            line-height: 30px;
                            display: flex;
                            align-items: center;
                            justify-content: space-between;

                            .more_box {
                                display: flex;
                                align-items: center;
                            }

                            .icon {
                                width: 16px;
                                height: 16px;
                            }
                        }

                        .section_item {
                            border-top-style: solid;
                            border-top: 1px dashed #ededed;
                            padding-left: 90px;
                            line-height: 26px;
                        }

                        .section_item dt {
                            float: left;
                            margin-left: -90px;
                            padding-top: 8px;
                            font-size: 16px;
                            color: #323232;
                        }

                        .section_item dd {
                            padding: 8px 0px;
                        }

                        .section_item dd span {
                            padding: 5px 8px;
                            font-size: 14px;
                            line-height: 14px;
                            white-space: nowrap;
                            color: #636363;
                        }

                        .section_item dd span:hover {
                            background-color: rgba(255, 0, 0, .1);;
                        }
                    }
                }

                .menu_two_val_choosed {
                    background-color: rgba(255, 0, 0, .1);
                }
            }
        }
    }

    .function_box {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        color: white;
        font-size: 12px;
        line-height: 12px;

        .search_box {
            box-sizing: border-box;
            padding: 4px 6px 4px 6px;
            opacity: 0;
            background: none;
            display: flex;
            align-items: center;
            border-radius: 3px;
            width: 20px;
            transition: all 0.2s linear;

            .search_input {
                width: 100%;
                font-size: 14px;
                border: 0;
                background-color: transparent;
                color: #636363;
                outline: none;
            }

            .search_icon {
                width: 16px;
                height: 16px;
                flex-shrink: 0;
            }
        }

        .search_box_focus {
            opacity: 1;
            background: #fff;
            width: 140px;
        }

        .search_icon_hidden {
            position: relative;
            width: 16px;
            height: 16px;
            left: -22px;
            z-index: -1;
        }

        .icon {
            width: 16px;
            height: 16px;
            margin-left: 14px;
        }

        .rigister, .login, .name_info {
            margin-left: 14px;
        }

        .avatar {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            margin-left: 16px;
        }
    }
}
</style>
